<%= error_messages_for 'identity' %>

<!--[form:identity]-->
<input type="hidden" id="identity_user_id" name="identity[user_id]" value="<%= session[:user] %>" />

<label>在</label>

<% if @identity.id %>
<%= @identity.site.name if @identity.site %>
<% else %>
<input id="site_name" name="site[name]" value='<%= @identity.site.name if @identity.site %>' />
<div class="auto_complete" id="site_name_auto_complete"></div>
<script type="text/javascript">
//<![CDATA[
var site_name_auto_completer = new Ajax.Autocompleter(
    'site_name', 'site_name_auto_complete', 
    '<%= url_for :controller => "identities", :action => "auto_complete_for_site_name" %>', {})
//]]>
</script>
&nbsp;&nbsp;
<%= link_to "添加一个新站点", {:controller => 'sites', :action => 'new'}, {:id => 'add_new_site'} %>
<% end %>
<br>
<label for="identity_name">我是</label>
<%= text_field 'identity', 'name'  %>

<br>
<label for="identity_public">公开?</label>
<%= check_box 'identity', 'public' %>
<p></p>
<!--[eoform:identity]-->

